package hy.线程.锁;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class A {
    Lock lock = new ReentrantLock();

    //a对象
    synchronized void m1(){
        System.out.println("a method");
        m2();
    }
    void m2(){

        lock.lock();
        System.out.println("a method");

        m3();
        lock.unlock();
    }
    synchronized void m3(){

    }
}
